package com.hx.dc.controllor;

import com.hx.dc.entity.StoreTable;
import com.hx.dc.entity.TableUser;
import com.hx.dc.service.StoreTableService;
import com.hx.dc.service.TableUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * Created by Mr.Lee on 2019/2/14.
 */
@Controller
@RequestMapping("tableuser")
public class TableUserAction extends BaseAction{

    @Autowired
    private TableUserService tableUserService;

    @RequestMapping(value = "/selectPage")
    @ResponseBody
    public Object selectPage(TableUser tableUser, Integer page, Integer rows){
        System.out.println("page:" + page + ",rows:" + rows);

        return this.getPage(tableUserService.selectPage(tableUser,page,rows));
    }

    @RequestMapping(value = "/bookTable")
    @ResponseBody
    public Object bookTable(TableUser tableUser){
        System.out.println("输入信息"+tableUser);
        return tableUserService.insert(tableUser);
    }

    @RequestMapping(value = "/updateTable")
    @ResponseBody
    public Object updateTable(TableUser tableUser){
        System.out.println("输入信息"+tableUser);
        return tableUserService.update(tableUser);
    }

    @RequestMapping(value = "/selectTime")
    @ResponseBody
    public Object select(TableUser tableUser){
        System.out.println("输入信息"+tableUser);
        List list = tableUserService.selectTime(tableUser);
        return list;
    }

}
